package com.xjtu.chapter06.ex6_1;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * @author yjq
 * @version 1.0
 * @date 2021/8/18 16:32
 */
public class Test {
    public static void main(String[] args) {
        Product ipad = new Product();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        try{
            System.out.println("请输入产品id: ");
            ipad.id = Integer.parseInt(in.readLine());
        }catch (NumberFormatException e){
            System.out.println("id 输入错误，必须输入数字");
            e.printStackTrace();
            System.exit(-1);
        }catch (IOException e){
            System.out.println("标注输入id有误");
            e.printStackTrace();
        }
    }
}
